<%@ page import="account.AccountInfo" %>
<%@ page import="java.util.List" %>
<%@ page import="com.opensymphony.xwork2.util.ValueStack" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title></title>
<link href="../../skin/default/global.css" rel="stylesheet" type="text/css" />
<link href="../../skin/default/layout.css" rel="stylesheet" type="text/css" />
</head>

<body class="admin-content admin-panel-body">	
	<table class="admin-panel" width="100%" height="100%"  cellSpacing="0" cellPadding="0">
		<thead>
		<tr>
			<td>
				<span class="round"></span>
				<b>账户列表</b>
				<a href="getAccountInfo.action" target="main" class="btn"><img src="../../skin/default/addaccount.png" />添加账户</a>
			</td>
		</tr>
		</thead>
		<tbody>
			<tr>
				<td>
				<div class="overflow">
        <%
          ValueStack vs = (ValueStack)request.getAttribute("struts.valueStack");
          List<AccountInfo> accounts = (List<AccountInfo>) vs.findValue("list");
          int accountID = (Integer) vs.findValue("accountID");

          if(accounts.size() == 0){
        %>
        <div class="alert">账户列表为空</div>
				<%
          }
        %>
					<ul class="userlist" id="userlist">
            <%
              for(AccountInfo account : accounts) {
            %>
            <li id="a<%=account.getAid()%>"><a target="main" href="getAccountInfo.action?accountID=<%=account.getAid()%>">
              <img src="../../skin/default/user.gif" /><%=account.getAname()%></a></li>
            <%
              }
            %>
          </ul>
				</div>
				</td>
			</tr>
		</tbody>
	</table>
<script src="../../common/jquery-1.3.2.min.js"></script>
<script src="../../common/fun.js"></script>
	<script>
		var list = new KS.List("userlist",true)
	  <%=accountID == 0 ? "" : "list.select('a" + accountID + "')"%>
	</script>	
</body>

</html>
